 #ifndef UTIL_H

//--------------------------------------------------------
//		DEFINITIONS
//--------------------------------------------------------

#define UTIL_H

using namespace std;
using namespace OpenMesh;

//--------------------------------------------------------
//		BUNDLED TYPES
//--------------------------------------------------------

enum SelectType {NONE, VERTEX, EDGE, FACE};

struct Selection
{
	SelectType					type;				// the type of thing selected (see enum)
	ModelFrame*					selectionSource;	// mesh from which the selection originates
	PolyMesh::VertexHandle		selectedVertex;		// vertex from source mesh (if one is selected)
	PolyMesh::EdgeHandle		selectedEdge;		// edge   from ...
	PolyMesh::FaceHandle		selectedFace;		// face   from ...

	Selection::Selection()
	{
		this->selectionSource = NULL;
		this->type = FACE;
	}

	Selection::~Selection(){};

	bool isEmpty() const
	{
		return	(type == VERTEX && selectedVertex == PolyMesh::InvalidVertexHandle) ||
				(type == EDGE && selectedEdge == PolyMesh::InvalidEdgeHandle) ||
				(type == FACE && selectedFace == PolyMesh::InvalidEdgeHandle);
	};
};

struct Sphere
{
	double	radius;
	Vec3d	center;

	Sphere::Sphere()
	{
		this->radius = -1;
	}

	static bool Sphere::isValid(Sphere sphere)
	{
		return (sphere.radius < 0);
	}
};

#endif